feat: default fp state filter#1546
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a default finality provider state filter that dynamically adjusts based on the selected BSN (Babylon Service Network) type. The change introduces logic to automatically set appropriate default provider statuses for different BSN configurations.
- Added
getDefaultProviderStatusfunction to determine appropriate default status based on BSN type - Updated filter initialization to use dynamic defaults instead of hardcoded "active" status
- Added useEffect to automatically update provider status when BSN selection changes
- Simplified filter display text by removing "Showing" prefix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| FinalityProviderBsnState.tsx | Implements core logic for dynamic default status filtering based on BSN type |
| FinalityProviders/FinalityProviderFilter.tsx | Updates filter display text formatting |
| Multistaking/FinalityProviders/FinalityProviderFilter.tsx | Updates filter display text formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| providerStatus: newProviderStatus, | ||
| })); | ||
| } | ||
| }, [selectedBsn, filter.providerStatus]); |
There was a problem hiding this comment.
The useEffect has filter.providerStatus in its dependency array, which could cause unnecessary re-renders. Since the effect only reads this value for comparison, consider using a ref to track the current status or restructure to avoid the dependency.
| }, [selectedBsn, filter.providerStatus]); | |
| }, [selectedBsn]); |
There was a problem hiding this comment.
@jeremy-babylonlabs could you check this comment?
jrwbabylonlab
left a comment
There was a problem hiding this comment.
For Rollup that have empty allow list. Will we show the "non-allow listed" as the default instead?
No description provided.